const mongoose = require('mongoose')

const normalSchema = new mongoose.Schema({
    username: {
        type: String,
        unique: true,
        require: [true, '用户名不能为空'],
    },
    email: {
        type: String,
        require: [true, '邮箱不能为空'],
    },
    type: {
        type: String,
        default: 'user'
    },
})

// 3.根据规则创建集合
const Normal = mongoose.model('Normal', normalSchema);


// 4.将集合做为模块成员进行导出
module.exports = Normal
